import React from 'react';
import {
  Text,
} from 'react-native';

import TComponent from './TComponent';

export default class TText extends TComponent {
  render() {
    return(
      <Text
        ...this.props
        style = {[this._getSizeStyle(), this._getFontSizeStyle()]}
      />
    )
  }

  _getFontSizeStyle() {
    let style = {};
    if(this.props.style.fontSize != undefined) {
      style.fontSize = this.props.translatedSize ? this.props.style.fontSize :
        SizeUtils.translateFontSizeToCode(this.props.style.fontSize);
    }
    return style;
  }
}
